<template>
 <div>
      <wv-button class="btn" type="default" @click="okBtn">完成</wv-button>
 </div>
</template>

<script>
import { Button, Toast } from 'we-vue'
export default {
  name: 'Okbtn',
  components: {
    Button,
    Toast
  },
  methods: {
    okBtn: function () {
      var descValue = this.$store.state.descValue
      var goodPrice = this.$store.state.goodPrice
      console.log(goodPrice)
      var goodWeight = this.$store.state.goodWeight
      var goodCar = this.$store.state.goodCar
      var goodType = this.$store.state.goodType
      if (descValue === '') {
        Toast.fail({
          duration: 1000,
          message: '请填写物品描述'
        })
      } else if (goodWeight === '') {
        Toast.fail({
          duration: 1000,
          message: '请选择物品重量'
        })
      } else if (goodCar === '') {
        Toast.fail({
          duration: 1000,
          message: '请选择载具类型'
        })
      } else if (goodType === '') {
        Toast.fail({
          duration: 1000,
          message: '请选择物品类型'
        })
      } else {
        Toast.loading('完成填写...')
        this.$router.push('/')
      }
    }
  }
}
</script>

<style lang="stylus">
.btn
   margin-top:.4rem
</style>
